# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: exkc <exkc@exkc.moe>
pkgname=device-linksys-jamaica
pkgdesc="Linksys EA9350 V3"
pkgver=2
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
	dtc
	linux-linksys-jamaica
	postmarketos-base
	u-boot-tools
"
makedepends="devicepkg-dev"
source="
	boot-image.its
	initfs-hook.sh
	deviceinfo
"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
	mkdir -p "$pkgdir/usr/share/u-boot/jamaica"
	install -D -m644 "$srcdir/boot-image.its" \
		"$pkgdir/usr/share/u-boot/jamaica"
}

nonfree_firmware() {
	pkgdesc="Linksys EA9350 firmware"
	depends="firmware-linksys-jamaica"
	mkdir "$subpkgdir"
}

sha512sums="
114f469383b811ff68504262f7ddc2c7554d93dcc7aeb3bdb0be503effc3acf18aebac0fa92df73a6b01f2f7e42dcb3a15b26b39cf2a1e0af16cf39edee65f9f  boot-image.its
565f1fa487083671cd643047054296c7d419d0d466013401141b0f991e65513e066c52c55b0cc9296f58f1623ce3df7e567bf05d1fd2e98ecfeb9177be6f4c3b  initfs-hook.sh
ad030f57607f6b9d866039f223eaf97275ea418f0751b051630940149d3aaa08129f24f3e7fae966cb91bcf0f6276164669367b7c603e5e253e85f0ad84d3dd0  deviceinfo
"
